.chat-container {
  display: flex;
  height: 100vh;
  width: 100%;
  background-color: #f9fafb;
  color: #111827;
  overflow: hidden;
}

/* Dark mode styles */
.dark {
  background-color: #111827;
  color: #f9fafb;
}

/* Sidebar */
.sidebar {
  width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  /*transform: translateX(-100%);*/
  /*opacity: 0;*/
  /*transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.5s ease;*/
  transition: all 0.3s ease; /* 简化过渡效果 */
  z-index: 10;
}

.dark .sidebar {
  background-color: #1f2937;
  border-right-color: #374151;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.sidebar.slide-in {
  transform: translateX(0);
  opacity: 1;
}

.user-profile {
  display: flex;
  align-items: center;
  padding: 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
}

.dark .user-profile {
  border-bottom-color: #374151;
  background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
  overflow: hidden;
  color: white;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.4);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.user-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.dark .user-name {
  color: #f3f4f6;
}

.sidebar-actions {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-section {
  padding: 0 1rem;
  margin-bottom: 1rem;
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.dark .section-title {
  color: #9ca3af;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dark .sidebar-footer {
  border-top-color: #374151;
}

.logout-btn {
  margin-top: 0.5rem;
}

/* Main chat area */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.dark .chat-main {
  background: linear-gradient(135deg, #111827 0%, #1e293b 100%);
}

.chat-main.fade-in {
  opacity: 1;
}

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  scroll-behavior: smooth;
}

.message {
  margin-bottom: 1.5rem;
  position: relative;
  transition: all 0.3s ease;
}

.message-bubble {
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  max-width: 80%;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.message-bubble:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.message.user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.message-bubble.user {
  background: linear-gradient(135deg, #79a2ea 0%, #175bef 100%);
  color: white;
  border-radius: 0.75rem 0.75rem 0 0.75rem;
}

.message-bubble.assistant {
  background: linear-gradient(135deg, #eeeef3 0%, #ffffff 100%);
  border-radius: 0.75rem 0.75rem 0.75rem 0;
  border: 1px solid #e5e7eb;
}

.dark .message-bubble.assistant {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  border-color: #374151;
  color: #f3f4f6;
}

.message-time {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.message-files {
  margin-top: 0.5rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  margin-top: 0.25rem;
  background-color: rgba(255, 255, 255, 0.2);
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  backdrop-filter: blur(4px);
}

.thinking-process {
  margin-bottom: 0.75rem;
}

.thinking-process details {
  background-color: #f9fafb;
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.3s ease;
}

.dark .thinking-process details {
  background-color: #1f2937;
}

.thinking-process details:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.thinking-process summary {
  padding: 0.625rem 0.875rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #4b5563;
  user-select: none;
}

.dark .thinking-process summary {
  color: #d1d5db;
}

.thinking-process summary .arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.thinking-process details[open] summary .arrow {
  transform: rotate(180deg);
}

.thinking-content {
  padding: 0.875rem;
  font-size: 0.875rem;
  line-height: 1.5;
  color: #4b5563;
  background-color: #f3f4f6;
  border-top: 1px solid #e5e7eb;
  animation: slideDown 0.3s ease;
}

.dark .thinking-content {
  color: #d1d5db;
  background-color: #111827;
  border-top-color: #374151;
}

.message-content {
  line-height: 1.5;
}

/* 代码块样式 */
:deep(.code-block-wrapper) {
  margin: 0rem 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background-color: rgb(9, 28, 35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

:deep(.code-header) {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: rgb(9, 28, 35);
  border-bottom: 1px solid #fffdfd;
}

:deep(.code-language) {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  font-weight: 600;
}

:deep(.code-copy-btn) {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  background-color: #3b3b3b;
  color: #e5e7eb;
  font-size: 0.75rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

:deep(.code-copy-btn:hover) {
  background-color: #4b4b4b;
}

:deep(.hljs) {
  padding: 1rem;
  border-radius: 0;
  background-color: rgba(12, 50, 64, 0);
  font-family: 'Fira Code', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-x: auto;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.message-bubble:hover .message-actions {
  opacity: 1;
  transform: translateY(0);
}

.suggested-questions {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.suggestions-title {
  font-size: 0.875rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suggestion-button {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

.suggestion-button:nth-child(1) { animation-delay: 0.1s; }
.suggestion-button:nth-child(2) { animation-delay: 0.2s; }
.suggestion-button:nth-child(3) { animation-delay: 0.3s; }
.suggestion-button:nth-child(4) { animation-delay: 0.4s; }

.suggestion-button:hover {
  background-color: #e5e7eb;
  transform: translateY(-2px);
}

/* Input area */
.input-container {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  padding: 0.625rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.input-wrapper:focus-within {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.message-input {
  flex: 1;
  border: none;
  outline: none;
  resize: none;
  padding: 0.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  max-height: 150px;
  background-color: transparent;
  transition: all 0.3s ease;
}

.input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.uploaded-files {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.uploaded-file {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background-color: #f3f4f6;
  padding: 0.375rem 0.625rem;
  border-radius: 0.375rem;
  font-size: 0.8125rem;
  animation: fadeIn 0.3s ease;
  transition: all 0.3s ease;
}

.uploaded-file:hover {
  background-color: #e5e7eb;
}

.remove-file {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.remove-file:hover {
  color: #ef4444;
  background-color: rgba(239, 68, 68, 0.1);
}

.hidden-input {
  display: none;
}

/* Buttons */
.action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid #e5e7eb;
  background-color: #ffffff;
  color: #4b5563;
  position: relative;
  overflow: hidden;
}

.action-button::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.action-button:active::after {
  animation: ripple 0.6s ease-out;
}

.action-button:hover {
  background-color: #f3f4f6;
  transform: translateY(-2px);
}

.action-button.primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  border-color: transparent;
}

.action-button.primary:hover {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 4px 6px rgba(37, 99, 235, 0.3);
}

.action-button.danger {
  color: #ef4444;
  border-color: #fecaca;
}

.action-button.danger:hover {
  background-color: #fee2e2;
  color: #dc2626;
}

.action-button.small {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
}

.action-button.icon-only {
  padding: 0.5rem;
  border-radius: 0.5rem;
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
}

.toggle-track {
  position: relative;
  width: 40px;
  height: 20px;
  background-color: #e5e7eb;
  border-radius: 10px;
  margin-right: 0.5rem;
  transition: background-color 0.3s ease;
}

.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease, background-color 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-thumb.active {
  transform: translateX(20px);
  background-color: #3b82f6;
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  background-color: #f3f4f6;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  margin-bottom: 1rem;
  animation: fadeIn 0.5s ease;
}

.dot {
  width: 8px;
  height: 8px;
  margin: 0 2px;
  background-color: #9ca3af;
  border-radius: 50%;
  animation: bounce 1.5s infinite;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Tooltip */
.tooltip-wrapper {
  position: relative;
}

.tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background-color: #1f2937;
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  margin-bottom: 5px;
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

.tooltip-wrapper:hover .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 知识库弹窗样式 */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 100;
}

.modal-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20%;
  max-width: 800px;
  max-height: 80vh;
  background-color: white;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  z-index: 101;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.close-button {
  background: none;
  border: none;
  cursor: pointer;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.close-button:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* 知识库列表样式 */
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.knowledge-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.knowledge-item:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateY(-2px);
}

.knowledge-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
}

.knowledge-name {
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
}

.knowledge-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.description {
  font-size: 0.875rem;
  color: #6b7280;
}

.stats {
  display: flex;
  gap: 0.75rem;
}

.document-count, .word-count {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: #6b7280;
  background-color: #f3f4f6;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
}

.knowledge-actions {
  display: flex;
  gap: 0.5rem;
}

.delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background-color: #fee2e2;
  color: #ef4444;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.delete-btn:hover {
  background-color: #fecaca;
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 0.625rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

/* 添加文档样式 */
.add-doc-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.5rem;
}

.tab-button {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tab-button.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tab-button:hover {
  color: #4b5563;
}

.file-upload-area {
  border: 2px dashed #d1d5db;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-upload-area:hover {
  border-color: #3b82f6;
  background-color: rgba(59, 130, 246, 0.05);
}

.upload-hint {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 0.5rem;
}

.selected-file {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.file-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.file-size {
  font-size: 0.75rem;
  color: #6b7280;
}

/* 文档列表样式 */
.documents-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.document-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.document-item:hover {
  background-color: #f3f4f6;
}

.document-info {
  flex: 1;
}

.document-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.document-details {
  display: flex;
  gap: 1rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.document-date, .document-word-count {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.document-actions {
  display: flex;
  gap: 0.5rem;
}

/* 文档内容样式 */
.document-content {
  background-color: #f9fafb;
  border-radius: 0.5rem;
  padding: 1rem;
  max-height: 50vh;
  overflow-y: auto;
}

.document-content pre {
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* 删除确认样式 */
.delete-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 1rem;
}

.delete-warning svg {
  color: #ef4444;
}

.warning-text {
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

/* 空状态样式 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  color: #6b7280;
}

.empty-state svg {
  margin-bottom: 1rem;
  color: #9ca3af;
}

/* 加载状态 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.loading-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

/* 通知样式 */
.notification {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 0.5rem;
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 24rem;
}

.notification.success {
  border-left: 4px solid #10b981;
}

.notification.error {
  border-left: 4px solid #ef4444;
}

.notification.info {
  border-left: 4px solid #3b82f6;
}

.notification-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.notification.success .notification-icon {
  color: #10b981;
}

.notification.error .notification-icon {
  color: #ef4444;
}

.notification.info .notification-icon {
  color: #3b82f6;
}

.notification-content {
  flex: 1;
  font-size: 0.875rem;
}

/* 复制成功提示 */
.copy-success-notification {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: #10b981;
  color: white;
  font-size: 0.875rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
  z-index: 1000;
  animation: fadeInDown 0.3s ease;
}

/* 分页样式 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  gap: 1rem;
}

.pagination-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #4b5563;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
  background-color: #e5e7eb;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

/* 深色模式分页样式 */
.dark .pagination-button {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .pagination-button:hover:not(:disabled) {
  background-color: #4b5563;
}

.dark .pagination-info {
  color: #9ca3af;
}

/* 动画 */
@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-6px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.5;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* Transition groups */
.message-fade-enter-active, .message-fade-leave-active {
  transition: all 0.5s ease;
}

.message-fade-enter-from, .message-fade-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

.fade-enter-active, .fade-leave-active {
  transition: opacity 0.5s ease;
}

.fade-enter-from, .fade-leave-to {
  opacity: 0;
}

.slide-up-enter-active, .slide-up-leave-active {
  transition: all 0.3s ease;
}

.slide-up-enter-from, .slide-up-leave-to {
  opacity: 0;
  transform: translateY(20px);
}

/* 深色模式 */
.dark .modal-container {
  background-color: #1f2937;
  color: #f9fafb;
}

.dark .modal-header,
.dark .modal-footer {
  border-color: #374151;
}

.dark .close-button {
  color: #9ca3af;
}

.dark .close-button:hover {
  background-color: #374151;
  color: #f9fafb;
}

.dark .knowledge-item {
  background-color: #111827;
  border-color: #374151;
}

.dark .knowledge-name {
  color: #f9fafb;
}

.dark .description {
  color: #9ca3af;
}

.dark .document-count,
.dark .word-count {
  background-color: #374151;
  color: #d1d5db;
}

.dark .form-input,
.dark .form-textarea {
  background-color: #1f2937;
  border-color: #4b5563;
  color: #f9fafb;
}

.dark .form-input:focus,
.dark .form-textarea:focus {
  border-color: #eceef3;
}

.dark .form-group label {
  color: #d1d5db;
}

.dark .file-upload-area {
  border-color: #4b5563;
}

.dark .file-upload-area:hover {
  background-color: rgba(59, 130, 246, 0.1);
}

.dark .selected-file,
.dark .document-item,
.dark .document-content {
  background-color: #111827;
  border-color: #374151;
}

.dark .notification {
  background-color: #1f2937;
  color: #f9fafb;
}

.dark .tab-button {
  color: #9ca3af;
}

.dark .tab-button.active {
  color: #3b82f6;
}

.dark .tab-button:hover {
  color: #d1d5db;
}

.dark :deep(.code-block-wrapper) {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.dark :deep(.code-header) {
  background-color: #1a1a1a;
  border-bottom: 1px solid #2a2a2a;
}

.dark :deep(.code-copy-btn) {
  background-color: #2a2a2a;
  color: #d1d5db;
}

.dark :deep(.code-copy-btn:hover) {
  background-color: #3a3a3a;
}

/* 响应式样式 */
@media (max-width: 768px) {
  .modal-container {
    width: 95%;
    max-height: 85vh;
  }

  .knowledge-item,
  .document-item {
    flex-direction: column;
    gap: 1rem;
  }

  .knowledge-actions,
  .document-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* 课程管理按钮样式 */
.class-btn {
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

/* 课程管理模态框样式 */
.class-modal {
  max-width: 800px;
}

.create-class-form {
  max-width: 500px;
}

/* 课组选择下拉框样式 */
select.form-input {
  appearance: none;
  padding-right: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
}

.dark select.form-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* 课程列表样式 */
.class-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.class-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  transition: all 0.2s ease;
}

.class-item:hover {
  background-color: #f3f4f6;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.class-info {
  flex: 1;
}

.class-name {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.class-kz {
  font-size: 0.75rem;
  color: #6b7280;
}

.class-actions {
  display: flex;
  gap: 0.5rem;
}

.dark .class-item {
  background-color: #111827;
  border-color: #374151;
}

.dark .class-item:hover {
  background-color: #1f2937;
}

.dark .class-kz {
  color: #9ca3af;
}

/* 添加到您的 Chat.css 文件中 */
/* CSS变量定义 */
:root {
  --color-border: #e0e0e0;
  --color-card-bg: #f8f8f8;
  --color-hover: #f1f1f1;
  --color-primary: #4f46e5;
  --color-primary-light: rgba(79, 70, 229, 0.1);
  --color-text-secondary: #6b7280;
}
/* 课程列表样式 */
.class-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.class-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-radius: 8px;
  background-color: var(--color-card-bg);
  transition: all 0.2s ease;
  cursor: pointer;
}

.class-item:hover {
  background-color: var(--color-hover);
}

.class-item.active {
  background-color: var(--color-primary-light);
  border-left: 3px solid var(--color-primary);
}

.class-info {
  flex: 1;
}

.class-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.class-details {
  display: flex;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

/* 学生管理面板 */
.student-management-panel {
  margin-top: 20px;
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.panel-header h4 {
  margin: 0;
  font-size: 1rem;
}

.student-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background-color: var(--color-card-bg);
  transition: all 0.2s ease;
}

.student-info {
  flex: 1;
}

.student-name {
  font-weight: 500;
  margin-bottom: 2px;
}

.student-details {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
}

/* 添加学生弹窗 */
.add-student-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
}

.tab-button {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.tab-button.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-button svg {
  width: 16px;
  height: 16px;
}

.preview-container {
  margin-top: 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.preview-header {
  padding: 10px 15px;
  background-color: var(--color-card-bg);
  border-bottom: 1px solid var(--color-border);
}

.preview-header h4 {
  margin: 0;
  font-size: 0.9rem;
}

.preview-students {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
}

.preview-student-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.preview-student-item:hover {
  background-color: var(--color-hover);
}

.student-preview {
  margin-top: 20px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}

.student-info-preview {
  padding: 15px;
}

.info-item {
  margin-bottom: 10px;
  display: flex;
}

.info-item .label {
  font-weight: 500;
  width: 60px;
}

.loading-container.small {
  padding: 20px;
}

.empty-state.small {
  padding: 30px;
}

.loading-container.small .loading-spinner {
  width: 30px;
  height: 30px;
}

.user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toggle-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-admin-btn:hover {
  background-color: #e5e7eb;
}

.dark .toggle-admin-btn {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .toggle-admin-btn:hover {
  background-color: #4b5563;
}

/* 管理界面样式 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  padding: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.dark .admin-main {
  background: #111827;
}

.admin-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-header {
  border-bottom-color: #374151;
}

.admin-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.dark .admin-header h2 {
  color: #f9fafb;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-item:hover {
  background-color: #f3f4f6;
}

.admin-nav-item.active {
  background-color: #edf2fd;
  border-color: #3b82f6;
  color: #3b82f6;
}

.dark .admin-nav-item {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .admin-nav-item:hover {
  background-color: #374151;
}

.dark .admin-nav-item.active {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.admin-content {
  flex: 1;
  overflow: auto;
}

.admin-panel {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.dark .admin-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-panel-header {
  border-bottom-color: #374151;
}

.admin-panel-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.admin-content-split {
  display: flex;
  gap: 1.5rem;
  height: 100%;
}

.class-list-panel {
  width: 30%;
  overflow-y: auto;
  max-height: 70vh;
}

/* 添加响应式样式 */
@media (max-width: 768px) {
  .admin-content-split {
    flex-direction: column;
  }

  .class-list-panel {
    width: 100%;
    max-height: 250px;
  }
}

/* 在原有样式基础上添加管理界面相关样式 */
.user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toggle-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-admin-btn:hover {
  background-color: #e5e7eb;
}

.dark .toggle-admin-btn {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .toggle-admin-btn:hover {
  background-color: #4b5563;
}

/* 管理界面样式 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  padding: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.dark .admin-main {
  background: #111827;
}

.admin-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-header {
  border-bottom-color: #374151;
}

.admin-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.dark .admin-header h2 {
  color: #f9fafb;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-item:hover {
  background-color: #f3f4f6;
}

.admin-nav-item.active {
  background-color: #edf2fd;
  border-color: #3b82f6;
  color: #3b82f6;
}

.dark .admin-nav-item {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .admin-nav-item:hover {
  background-color: #374151;
}

.dark .admin-nav-item.active {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.admin-content {
  flex: 1;
  overflow: auto;
}

.admin-panel {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.dark .admin-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-panel-header {
  border-bottom-color: #374151;
}

.admin-panel-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.admin-content-split {
  display: flex;
  gap: 1.5rem;
  height: 100%;
}

.class-list-panel {
  width: 30%;
  overflow-y: auto;
  max-height: 70vh;
}

/* 添加响应式样式 */
@media (max-width: 768px) {
  .admin-content-split {
    flex-direction: column;
  }

  .class-list-panel {
    width: 100%;
    max-height: 250px;
  }
}

/* 改进的用户信息和管理按钮样式 */
.user-profile {
  position: relative;
  padding: 1.25rem;
}

.user-info {
  flex: 1;
}

.user-name-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.teacher-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background-color: #3b82f6;
  color: white;
  border-radius: 0.25rem;
  font-weight: 500;
}

.dark .teacher-badge {
  background-color: #60a5fa;
}

.management-toggle-btn {
  position: absolute;
  top: 1.25rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.8rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.management-toggle-btn:hover {
  background-color: #e5e7eb;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .management-toggle-btn {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .management-toggle-btn:hover {
  background-color: #4b5563;
}

.toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  color: #3b82f6;
}

.dark .toggle-icon {
  background-color: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
}

/* 改进的课程管理样式 */
.admin-content-split {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 200px);
  min-height: 400px;
}

.class-list-panel {
  width: 30%;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark .class-list-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-section-header {
  border-bottom-color: #374151;
}

.panel-section-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.class-count {
  font-size: 0.8rem;
  color: #6b7280;
  background-color: #f3f4f6;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.dark .class-count {
  color: #d1d5db;
  background-color: #374151;
}

.class-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.class-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.class-item:hover {
  background-color: #f9fafb;
}

.class-item.active {
  background-color: #f0f7ff;
  border-color: #bfdbfe;
}

.dark .class-item:hover {
  background-color: #111827;
}

.dark .class-item.active {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

.student-management-panel {
  flex: 1;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark .student-management-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-header {
  border-bottom-color: #374151;
}

.panel-title {
  display: flex;
  flex-direction: column;
}

.panel-title h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dark .panel-subtitle {
  color: #9ca3af;
}

.student-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

.student-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  background-color: #f9fafb;
  border: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.student-item:hover {
  background-color: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.dark .student-item {
  background-color: #111827;
  border-color: #1f2937;
}

.dark .student-item:hover {
  background-color: #1f2937;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.empty-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-panel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #6b7280;
  padding: 2rem;
}

.empty-panel-content svg {
  margin-bottom: 1rem;
  color: #9ca3af;
}

.dark .empty-panel-content {
  color: #9ca3af;
}

.dark .empty-panel-content svg {
  color: #6b7280;
}

/* 响应式样式优化 */
@media (max-width: 768px) {
  .admin-content-split {
    flex-direction: column;
    height: auto;
  }

  .class-list-panel {
    width: 100%;
    margin-bottom: 1rem;
    max-height: 300px;
  }

  .management-toggle-btn {
    position: static;
    margin-top: 0.75rem;
    width: 100%;
    justify-content: center;
  }

  .user-profile {
    flex-direction: column;
    align-items: flex-start;
  }

  .avatar {
    margin-bottom: 0.75rem;
  }
}
/* 在原有样式基础上添加管理界面相关样式 */
.user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toggle-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-admin-btn:hover {
  background-color: #e5e7eb;
}

.dark .toggle-admin-btn {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .toggle-admin-btn:hover {
  background-color: #4b5563;
}

/* 管理界面样式 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  padding: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.dark .admin-main {
  background: #111827;
}

.admin-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-header {
  border-bottom-color: #374151;
}

.admin-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.dark .admin-header h2 {
  color: #f9fafb;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-item:hover {
  background-color: #f3f4f6;
}

.admin-nav-item.active {
  background-color: #edf2fd;
  border-color: #3b82f6;
  color: #3b82f6;
}

.dark .admin-nav-item {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .admin-nav-item:hover {
  background-color: #374151;
}

.dark .admin-nav-item.active {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.admin-content {
  flex: 1;
  overflow: auto;
}

.admin-panel {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.dark .admin-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-panel-header {
  border-bottom-color: #374151;
}

.admin-panel-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

/* Course management styles */
.admin-content-split {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 200px);
  min-height: 400px;
}

.class-list-panel {
  width: 30%;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark .class-list-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-section-header {
  border-bottom-color: #374151;
}

.panel-section-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.class-count {
  font-size: 0.8rem;
  color: #6b7280;
  background-color: #f3f4f6;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.dark .class-count {
  color: #d1d5db;
  background-color: #374151;
}

.class-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.class-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.class-item:hover {
  background-color: #f9fafb;
}

.class-item.active {
  background-color: #f0f7ff;
  border-color: #bfdbfe;
}

.dark .class-item:hover {
  background-color: #111827;
}

.dark .class-item.active {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

/* Student management panel styles */
.student-management-panel {
  flex: 1;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark .student-management-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-header {
  border-bottom-color: #374151;
}

.panel-title {
  display: flex;
  flex-direction: column;
}

.panel-title h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dark .panel-subtitle {
  color: #9ca3af;
}

/* Student list styles with multi-select and avatars */
.student-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.student-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .student-list-header {
  border-bottom-color: #374151;
}

.student-selection {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.student-selection input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.batch-remove-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.student-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.student-card.selected {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.dark .student-card {
  background-color: #1f2937;
  border-color: #374151;
}

.dark .student-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dark .student-card.selected {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

.student-selection-checkbox {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.student-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-details {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #6b7280;
}

.dark .student-details {
  color: #9ca3af;
}

.student-id, .student-class {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.dark .pagination {
  border-top-color: #374151;
}

.pagination-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
  background-color: #f3f4f6;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dark .pagination-button {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .pagination-button:hover:not(:disabled) {
  background-color: #374151;
}

.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .pagination-info {
  color: #9ca3af;
}

/* Empty state styles */
.empty-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-panel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #6b7280;
  padding: 2rem;
}

.empty-panel-content svg {
  margin-bottom: 1rem;
  color: #9ca3af;
}

.dark .empty-panel-content {
  color: #9ca3af;
}

.dark .empty-panel-content svg {
  color: #6b7280;
}

/* Loading styles */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.loading-container.small {
  padding: 1rem;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .admin-content-split {
    flex-direction: column;
    height: auto;
  }

  .class-list-panel {
    width: 100%;
    margin-bottom: 1rem;
    max-height: 300px;
  }

  .student-grid {
    grid-template-columns: 1fr;
  }

  .student-card {
    padding: 0.75rem;
  }

  .student-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }
}
/* 在原有样式基础上添加管理界面相关样式 */
.user-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.toggle-admin-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem;
  margin-top: 0.5rem;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-admin-btn:hover {
  background-color: #e5e7eb;
}

.dark .toggle-admin-btn {
  background-color: #374151;
  border-color: #4b5563;
  color: #e5e7eb;
}

.dark .toggle-admin-btn:hover {
  background-color: #4b5563;
}

/* 管理界面样式 */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f9fafb;
  padding: 1.5rem;
  animation: fadeIn 0.5s ease;
}

.dark .admin-main {
  background: #111827;
}

.admin-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-header {
  border-bottom-color: #374151;
}

.admin-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.dark .admin-header h2 {
  color: #f9fafb;
}

.admin-nav {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.admin-nav-item:hover {
  background-color: #f3f4f6;
}

.admin-nav-item.active {
  background-color: #edf2fd;
  border-color: #3b82f6;
  color: #3b82f6;
}

.dark .admin-nav-item {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .admin-nav-item:hover {
  background-color: #374151;
}

.dark .admin-nav-item.active {
  background-color: #2563eb;
  border-color: #3b82f6;
  color: #ffffff;
}

.admin-content {
  flex: 1;
  overflow: auto;
}

.admin-panel {
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.dark .admin-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.admin-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .admin-panel-header {
  border-bottom-color: #374151;
}

.admin-panel-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

/* Course management styles */
.admin-content-split {
  display: flex;
  gap: 1.5rem;
  height: calc(100vh - 230px); /* Adjusted to use more vertical space */
  min-height: 500px; /* Increased minimum height */
}

.class-list-panel {
  width: 30%;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.dark .class-list-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-section-header {
  border-bottom-color: #374151;
}

.panel-section-header h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.class-count {
  font-size: 0.8rem;
  color: #6b7280;
  background-color: #f3f4f6;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
}

.dark .class-count {
  color: #d1d5db;
  background-color: #374151;
}

.class-list-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
}

.class-item {
  padding: 0.75rem;
  border-radius: 0.5rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.class-item:hover {
  background-color: #f9fafb;
}

.class-item.active {
  background-color: #f0f7ff;
  border-color: #bfdbfe;
}

.dark .class-item:hover {
  background-color: #111827;
}

.dark .class-item.active {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

/* Student management panel styles */
.student-management-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-height: none; /* Remove max-height limitation */
  overflow: hidden;
}

.dark .student-management-panel {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .panel-header {
  border-bottom-color: #374151;
}

.panel-title {
  display: flex;
  flex-direction: column;
}

.panel-title h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.panel-subtitle {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 0.25rem;
}

.dark .panel-subtitle {
  color: #9ca3af;
}

/* Student list styles with multi-select and avatars */
.student-list {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem; /* Reduced gap for more compact display */
  max-height: none; /* Remove max-height limitation */
}

.student-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}

.dark .student-list-header {
  border-bottom-color: #374151;
}

.student-selection {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.student-selection input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.batch-remove-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); /* Smaller minimum width */
  gap: 0.75rem; /* Reduced gap between cards */
  margin-bottom: 1rem; /* Add margin at the bottom */
}

.student-card {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.75rem; /* Reduced padding */
  background-color: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #f3f4f6;
  transition: all 0.2s ease;
}

.student-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.student-card.selected {
  background-color: #eff6ff;
  border-color: #bfdbfe;
}

.dark .student-card {
  background-color: #1f2937;
  border-color: #374151;
}

.dark .student-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dark .student-card.selected {
  background-color: #1e3a8a;
  border-color: #3b82f6;
}

.student-selection-checkbox {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
}

.student-avatar {
  width: 2.25rem; /* Slightly smaller */
  height: 2.25rem; /* Slightly smaller */
  margin-right: 0.5rem; /* Reduced margin */
}

.student-info {
  flex: 1;
  min-width: 0;
}

.student-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-details {
  display: flex;
  flex-direction: column;
  font-size: 0.75rem;
  color: #6b7280;
}

.dark .student-details {
  color: #9ca3af;
}

.student-id, .student-class {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pagination styles */
.pagination {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid #e5e7eb;
}

.dark .pagination {
  border-top-color: #374151;
}

.pagination-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pagination-button:hover:not(:disabled) {
  background-color: #f3f4f6;
}

.pagination-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dark .pagination-button {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .pagination-button:hover:not(:disabled) {
  background-color: #374151;
}

.pagination-info {
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .pagination-info {
  color: #9ca3af;
}

/* Empty state styles */
.empty-panel {
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-panel-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: #6b7280;
  padding: 2rem;
}

.empty-panel-content svg {
  margin-bottom: 1rem;
  color: #9ca3af;
}

.dark .empty-panel-content {
  color: #9ca3af;
}

.dark .empty-panel-content svg {
  color: #6b7280;
}

/* Loading styles */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.loading-container.small {
  padding: 1rem;
}

.loading-spinner {
  width: 2rem;
  height: 2rem;
  border: 3px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .admin-content-split {
    flex-direction: column;
    height: auto;
  }

  .class-list-panel {
    width: 100%;
    margin-bottom: 1rem;
    max-height: 300px;
  }

  .student-grid {
    grid-template-columns: 1fr;
  }

  .student-card {
    padding: 0.75rem;
  }

  .student-avatar {
    width: 2rem;
    height: 2rem;
    font-size: 0.875rem;
  }
}

/* 添加学生标识样式 */
.student-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  background-color: #3b82f6;
  color: white;
  border-radius: 0.25rem;
  font-weight: 500;
}

/* Course Grid Styles */
.course-grid-container {
  width: 100%;
  padding: 1.5rem;
  background-color: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.dark .course-grid-container {
  background-color: #1f2937;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.course-grid-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.course-grid-header h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
}

.course-card {
  background-color: #f9fafb;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  border-color: #bfdbfe;
}

.dark .course-card {
  background-color: #111827;
  border-color: #374151;
}

.dark .course-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
  border-color: #3b82f6;
}

.course-card-header {
  padding: 1.25rem;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.course-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

.course-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.course-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.course-stat {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.dark .course-stat {
  color: #9ca3af;
}

.course-stat svg {
  color: #3b82f6;
}

.dark .course-stat svg {
  color: #60a5fa;
}

@media (max-width: 768px) {
  .course-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* Welcome container styles */
.welcome-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 2rem;
  max-width: 600px;
  margin: 0 auto;
  animation: fadeIn 0.8s ease-out;
}

.welcome-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  border-radius: 50%;
  color: white;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
  animation: pulse 3s infinite ease-in-out;
}

.welcome-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #111827;
}

.dark .welcome-title {
  color: #f9fafb;
}

.welcome-message {
  font-size: 1.1rem;
  color: #4b5563;
  margin-bottom: 2rem;
  line-height: 1.5;
}

.dark .welcome-message {
  color: #d1d5db;
}

.welcome-suggestions {
  width: 100%;
}

.welcome-suggestions .suggestions-title {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 1rem;
}

.dark .welcome-suggestions .suggestions-title {
  color: #9ca3af;
}

.welcome-suggestions .suggestions-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.welcome-suggestions .suggestion-button {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.9375rem;
  color: #4b5563;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease forwards;
  opacity: 0;
  transform: translateY(10px);
}

.welcome-suggestions .suggestion-button:nth-child(1) { animation-delay: 0.1s; }
.welcome-suggestions .suggestion-button:nth-child(2) { animation-delay: 0.2s; }
.welcome-suggestions .suggestion-button:nth-child(3) { animation-delay: 0.3s; }
.welcome-suggestions .suggestion-button:nth-child(4) { animation-delay: 0.4s; }

.welcome-suggestions .suggestion-button:hover {
  background-color: #e5e7eb;
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dark .welcome-suggestions .suggestion-button {
  background-color: #1f2937;
  border-color: #374151;
  color: #e5e7eb;
}

.dark .welcome-suggestions .suggestion-button:hover {
  background-color: #374151;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Add this pulse animation for the logo */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
  }
}

/* 改进的折叠侧边栏样式 */
.sidebar.collapsed {
  /*width: 150px; */
  /* 稍窄一些 */
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  height: 2%; /* 确保侧边栏占满整个高度 */
  position: relative;
}

/* 折叠状态下的用户资料 */
.sidebar.collapsed .user-profile {
  /*display: flex;*/
  /*flex-direction: column;*/
  align-items: center;
  width: 100%;
  /*padding: 0.75rem 0;*/
  /*border-bottom: 1px solid rgba(229, 231, 235, 0.5);*/
}

/* 折叠状态下的头像 */
/*.sidebar.collapsed .avatar {*/
/*  margin: 0 auto;*/
/*  width: 40px;*/
/*  height: 40px;*/
/*  min-width: 40px;*/
/*}*/

/*.sidebar.collapsed .user-info span {*/
/*  font-size: 0.65rem;*/
/*  display: block;*/
/*  white-space: nowrap;*/
/*  overflow: hidden;*/
/*  text-overflow: ellipsis;*/
/*  padding: 0 2px;*/
/*}*/


/* 折叠按钮位置 */
/*.sidebar.collapsed .toggle-sidebar-btn {*/
/*  position: absolute;*/
/*  top: 20px; !* 位于用户信息下方 *!*/
/*  right: -20px;*/
/*  width: 24px;*/
/*  height: 24px;*/
/*  border-radius: 50%;*/
/*  background-color: #f3f4f6;*/
/*  border: 1px solid #e5e7eb;*/
/*  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);*/
/*  display: flex;*/
/*  align-items: center;*/
/*  justify-content: center;*/
/*  z-index: 10;*/
/*}*/

.sidebar.collapsed .toggle-sidebar-btn svg {
  width: 14px;
  height: 14px;
}

/* 在折叠模式下隐藏这些部分 */
/*.sidebar.collapsed .sidebar-actions,*/
/*.sidebar.collapsed .sidebar-section,*/
/*.sidebar.collapsed .sidebar-footer,*/
/*.sidebar.collapsed .management-toggle-btn {*/
/*  display: none;*/
/*}*/

/* 管理页面中的侧边栏切换按钮 - 更大更明显 */
.admin-panel .toggle-sidebar-btn {
  position: absolute;
  left: 16px;  /* 位置调整，更突出 */
  top: 20px;
  width: 36px;  /* 更大的尺寸 */
  height: 36px;
  border-radius: 50%;
  background-color: #3b82f6;  /* 使用醒目的蓝色背景 */
  color: white;
  border: 2px solid #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 20;  /* 提高层级确保可见 */
  animation: pulse-attention 1.5s ease-in-out 3;  /* 初次加载时吸引注意力 */
}

.admin-panel .toggle-sidebar-btn:hover {
  background-color: #2563eb;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.admin-panel .toggle-sidebar-btn svg {
  width: 20px;  /* 图标也相应变大 */
  height: 20px;
  color: white;  /* 白色图标更醒目 */
  transition: transform 0.3s ease;
}

.admin-panel .toggle-sidebar-btn:hover svg {
  transform: rotate(180deg);  /* 悬停时轻微旋转，提供交互反馈 */
}

/* 按钮的脉动动画效果 */
@keyframes pulse-attention {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(59, 130, 246, 0);
    transform: scale(1.15);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    transform: scale(1);
  }
}

/* 调整面板标题区域，确保有足够空间 */
.admin-panel-header {
  position: relative;
  padding-left: 70px;  /* 增加左侧填充，为更大的按钮腾出空间 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* 添加指示性标签，首次打开时显示，帮助用户发现按钮 */
.admin-panel .toggle-sidebar-btn::after {
  content: "返回对话";
  position: absolute;
  left: 45px;
  white-space: nowrap;
  background-color: #3b82f6;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.admin-panel .toggle-sidebar-btn:hover::after {
  opacity: 1;
  transform: translateX(0);
}

.dark .admin-panel .toggle-sidebar-btn::after {
  background-color: #60a5fa;
  color: #111827;
}


/* 顶部横幅样式 - 修复遮挡问题 */
.header-banner {
  position: fixed;
  top: 0;
  left: 0; /* 与侧边栏宽度一致 */
  right: 0;
  height: 80px; /* 固定高度 */
  background: linear-gradient(135deg, #ffffff, #ffffff, #ffffff);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgb(255, 255, 255);
  overflow: hidden;
  z-index: 5; /* 确保在适当的层级 */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 侧边栏折叠时调整位置 */
.sidebar.collapsed + .chat-main .header-banner,
.sidebar.collapsed ~ .admin-main .header-banner {
  left: 150px; /* 与折叠后侧边栏宽度一致 */
}

/* 闪光标题文字效果 */
.shimmer-title {
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(
          90deg,
          rgba(255, 255, 255, 0) 0%,
          #3b82f6 50%,
          rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% auto;
  color: #fff; /* 备用颜色 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
  text-align: center;
}

/* 为主内容区域(.chat-main和.admin-main)添加响应式宽度调整 */
.chat-main, .admin-main {
  flex: 1;
  transition: all 0.3s ease;
  margin-top: 57px; /* 与横幅高度一致 */
  width: calc(100% - 280px); /* 默认状态下减去侧边栏宽度 */
}

/* 消息容器高度调整 */
.messages-container {
  height: calc(100% - 80px);
}

/* 闪光动画 */
@keyframes shimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}

/* 添加有效的折叠侧边栏样式，取消注释并修改 */
.sidebar.collapsed {
  width: 0;
  min-width: 0;
  margin-left: -1px; /* 完全隐藏侧边栏 */
  overflow: hidden;
}

/* Update the sidebar to have position: relative */
.sidebar {
  width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: #ffffff;
  border-right: 1px solid #e5e7eb;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  z-index: 10;
  position: relative; /* Add this for absolute positioning context */
}

/* Position the footer absolutely at the bottom */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: absolute; /* Position absolutely */
  bottom: 10px; /* Stick to bottom */
  left: 0; /* Align left */
  width: 100%; /* Full width */
  background-color: #ffffff; /* Match sidebar background */
}

.dark .sidebar-footer {
  border-top-color: #374151;
  background-color: #1f2937; /* Match dark mode sidebar background */
}

/* Add padding to the bottom of sidebar-section to prevent overlap */
.sidebar-section {
  margin-bottom: 1rem;
  flex: 1;
  overflow-y: auto; /* Change to auto to allow scrolling */
  display: flex;
  flex-direction: column;
}

/* 退出登录弹窗样式改进 */
.logout-modal {
  width: 350px;
  max-width: 90%;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  animation: modalFadeIn 0.3s ease;
}

.logout-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.5rem;
}

.logout-warning svg {
  color: #3b82f6;
  margin-bottom: 1.5rem;
  width: 60px;
  height: 60px;
  animation: pulseLogout 2s infinite ease-in-out;
}

.logout-warning p {
  font-size: 1.2rem;
  font-weight: 500;
  margin: 0;
  color: #1f2937;
}

.dark .logout-warning p {
  color: #f9fafb;
}

.dark .logout-warning svg {
  color: #60a5fa;
}

/* 优化退出确认按钮 */
.modal-footer .action-button.danger {
  background-color: #ef4444;
  color: white;
  border-color: transparent;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
}

.modal-footer .action-button.danger:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 6px rgba(239, 68, 68, 0.3);
}

@keyframes pulseLogout {
  0% {
    transform: scale(1);
    opacity: 0.9;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0.9;
  }
}

button:disabled {
  opacity: 0.5; /* 将禁用按钮的透明度降低 */
  cursor: not-allowed; /* 更改鼠标指针为禁止样式 */
  background-color: #e0e0e0; /* 设置禁用时的背景颜色 */
  color: #888; /* 设置禁用时的字体颜色 */
}

/* 启用状态下的样式 */
button {
  background-color: #007bff; /* 例如设置按钮正常时的背景颜色 */
  color: white; /* 正常时文字颜色 */
  cursor: pointer; /* 鼠标样式 */
}
.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  height: 100%;
}

.course-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: auto;
}

.dark .course-card-footer {
  border-top-color: #374151;
}

.course-card-header,
.course-card-body {
  cursor: pointer;
}

/* Make sure the buttons don't trigger the card click */
.course-card-footer button {
  z-index: 2;
}

/* Add hover effect for buttons */
.course-card-footer .action-button:hover {
  transform: translateY(-2px);
}

.course-card-footer .action-button.danger:hover {
  background-color: #fee2e2;
}

.dark .course-card-footer .action-button.danger:hover {
  background-color: #7f1d1d;
}

/* Avatar dropdown styles */
.avatar {
  position: relative;
  cursor: pointer;
}

.avatar-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 8px;
  width: 160px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  overflow: hidden;
  animation: fadeIn 0.2s ease-out;
  background: white; /* 确保有背景色，避免透明 */
  display: block; /* 明确设置显示样式 */
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  transition: background-color 0.2s;
}


/* Password modal specific styles */
.password-modal {
  max-width: 400px;
}

.error-message {
  color: #e53935;
  background-color: rgba(229, 57, 53, 0.1);
  padding: 10px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

@keyframes fadeIn {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.header-banner {
  padding: 15px 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: visible; /* 确保内容不被截断 */
}

.shimmer-title {
  display: block; /* 改为块级元素，不使用flex布局 */
  line-height: 1.4;
  text-align: center; /* 文本左对齐 */
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  margin: 0; /* 移除默认边距 */
  padding: 0; /* 移除默认内边距 */
}

.shimmer-title .main-title {
  display: flex;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #2563eb;
  letter-spacing: 0.5px;
  position: relative;
  padding: 0; /* 移除可能导致遮挡的内边距 */
}

.shimmer-title .sub-title {
  display: flex;
  font-size: 1.4rem;
  font-weight: 400;
  color: #4b5563;
  line-height: 1.5;
}

/* 简化的渐变效果，避免可能的渲染问题 */
.shimmer-title .main-title {
  font-size: 1.9rem;
  font-weight: 700;
  background: linear-gradient(
          90deg,
          rgba(255, 255, 255, 0) 0%,
          #3b82f6 50%,
          rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% auto;
  color: #fff; /* 备用颜色 */
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 3s linear infinite;
  text-align: center;
}

.message.interrupted .message-content {
  opacity: 0.7;
  border-left: 3px solid #ff6b6b;
}

/* Add this to your CSS */
pre {
  background-color: #f5f5f5;
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
  margin: 16px 0;
}

code {
  font-family: 'Courier New', Courier, monospace;
  white-space: pre-wrap;
  word-break: break-word;
}

.hljs {
  display: block;
  padding: 0;
  background: transparent;
}

.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em;
  background: #282c34;
  color: #abb2bf;
  border-radius: 6px;
  font-family: 'Fira Code', 'Consolas', monospace;
  line-height: 1.5;
  font-size: 14px;
}

.code-block-wrapper {
  position: relative;
  margin: 1rem 0;
  border-radius: 6px;
  overflow: hidden;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 1rem;
  background-color: #21252b;
  color: #abb2bf;
  font-size: 0.85rem;
}

.code-language {
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.75rem;
}

.code-copy-btn {
  background: #4d4d4d;
  border: none;
  border-radius: 4px;
  color: #e5e7eb;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.code-copy-btn:hover {
  background: #5a5a5a;
}
